﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using Database.Classes;


public partial class StoredProcedures
{
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void SubmitBugReport(string type, string comment, string status)
    {
        using (SqlConnection conn = new SqlConnection(StaticMethods.ConnectionString()))
        {
            conn.Open();
            using (SqlCommand cmd = new SqlCommand("Insert into Bugs Values (@t, @c, @s, @q)", conn))
            {
                cmd.Parameters.Add("@t", SqlDbType.NVarChar).Value = type;
                cmd.Parameters.Add("@s", SqlDbType.NVarChar).Value = status;
                cmd.Parameters.Add("@c", SqlDbType.NVarChar).Value = comment;
                cmd.Parameters.Add("@q", SqlDbType.DateTime).Value = DateTime.Now;
                cmd.ExecuteNonQuery();
            }
        }
    }
};
